.class Lcom/nemustech/regina/XMLRecordAdapter;
.super Landroid/widget/ArrayAdapter;
.source "ReginaCheckForUpdate.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Lcom/nemustech/regina/XMLRecord;",
        ">;"
    }
.end annotation


# instance fields
.field private context:Lcom/nemustech/regina/ReginaCheckForUpdate;

.field private items:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/nemustech/regina/XMLRecord;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method constructor <init>(Landroid/content/Context;ILjava/util/ArrayList;)V
    .locals 0
    .parameter "context"
    .parameter "textViewResourceId"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "I",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/nemustech/regina/XMLRecord;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 443
    .local p3, items:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/nemustech/regina/XMLRecord;>;"
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    .line 444
    iput-object p3, p0, Lcom/nemustech/regina/XMLRecordAdapter;->items:Ljava/util/ArrayList;

    .line 445
    check-cast p1, Lcom/nemustech/regina/ReginaCheckForUpdate;

    .end local p1
    iput-object p1, p0, Lcom/nemustech/regina/XMLRecordAdapter;->context:Lcom/nemustech/regina/ReginaCheckForUpdate;

    .line 446
    return-void
.end method


# virtual methods
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 9
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 450
    move-object v3, p2

    .line 451
    .local v3, v:Landroid/view/View;
    if-nez v3, :cond_0

    .line 452
    iget-object v5, p0, Lcom/nemustech/regina/XMLRecordAdapter;->context:Lcom/nemustech/regina/ReginaCheckForUpdate;

    const-string v6, "layout_inflater"

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/view/LayoutInflater;

    .line 453
    .local v4, vi:Landroid/view/LayoutInflater;
    const v5, 0x7f03000d

    const/4 v6, 0x0

    invoke-virtual {v4, v5, v6}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v3

    .line 456
    .end local v4           #vi:Landroid/view/LayoutInflater;
    :cond_0
    iget-object v5, p0, Lcom/nemustech/regina/XMLRecordAdapter;->items:Ljava/util/ArrayList;

    invoke-virtual {v5, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/regina/XMLRecord;

    .line 457
    .local v1, record:Lcom/nemustech/regina/XMLRecord;
    if-eqz v1, :cond_2

    .line 459
    const v5, 0x7f090027

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 460
    .local v2, tv:Landroid/widget/TextView;
    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 463
    const v5, 0x7f090028

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    .end local v2           #tv:Landroid/widget/TextView;
    check-cast v2, Landroid/widget/TextView;

    .line 464
    .restart local v2       #tv:Landroid/widget/TextView;
    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->getCurrentVersionCode()I

    move-result v5

    packed-switch v5, :pswitch_data_0

    .line 470
    iget-object v5, p0, Lcom/nemustech/regina/XMLRecordAdapter;->context:Lcom/nemustech/regina/ReginaCheckForUpdate;

    const v6, 0x7f07006c

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x1

    new-array v6, v6, [Ljava/lang/Object;

    const/4 v7, 0x0

    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->getCurrentVersionName()Ljava/lang/String;

    move-result-object v8

    aput-object v8, v6, v7

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 475
    :goto_0
    const v5, 0x7f090029

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    .end local v2           #tv:Landroid/widget/TextView;
    check-cast v2, Landroid/widget/TextView;

    .line 476
    .restart local v2       #tv:Landroid/widget/TextView;
    iget-object v5, p0, Lcom/nemustech/regina/XMLRecordAdapter;->context:Lcom/nemustech/regina/ReginaCheckForUpdate;

    const v6, 0x7f07006d

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x1

    new-array v6, v6, [Ljava/lang/Object;

    const/4 v7, 0x0

    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->getServerVersionName()Ljava/lang/String;

    move-result-object v8

    aput-object v8, v6, v7

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 479
    iget-object v5, p0, Lcom/nemustech/regina/XMLRecordAdapter;->context:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-virtual {v5}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f050019

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    .line 480
    .local v0, color:I
    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->canUpdated()Z

    move-result v5

    if-nez v5, :cond_1

    .line 481
    iget-object v5, p0, Lcom/nemustech/regina/XMLRecordAdapter;->context:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-virtual {v5}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f050018

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    .line 483
    :cond_1
    const v5, 0x7f090027

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    .end local v2           #tv:Landroid/widget/TextView;
    check-cast v2, Landroid/widget/TextView;

    .line 484
    .restart local v2       #tv:Landroid/widget/TextView;
    invoke-virtual {v2, v0}, Landroid/widget/TextView;->setTextColor(I)V

    .line 485
    const v5, 0x7f090028

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    .end local v2           #tv:Landroid/widget/TextView;
    check-cast v2, Landroid/widget/TextView;

    .line 486
    .restart local v2       #tv:Landroid/widget/TextView;
    invoke-virtual {v2, v0}, Landroid/widget/TextView;->setTextColor(I)V

    .line 487
    const v5, 0x7f090029

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    .end local v2           #tv:Landroid/widget/TextView;
    check-cast v2, Landroid/widget/TextView;

    .line 488
    .restart local v2       #tv:Landroid/widget/TextView;
    invoke-virtual {v2, v0}, Landroid/widget/TextView;->setTextColor(I)V

    .line 490
    .end local v0           #color:I
    .end local v2           #tv:Landroid/widget/TextView;
    :cond_2
    return-object v3

    .line 467
    .restart local v2       #tv:Landroid/widget/TextView;
    :pswitch_0
    iget-object v5, p0, Lcom/nemustech/regina/XMLRecordAdapter;->context:Lcom/nemustech/regina/ReginaCheckForUpdate;

    const v6, 0x7f07006b

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 464
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method

.method public isEnabled(I)Z
    .locals 1
    .parameter "position"

    .prologue
    .line 496
    invoke-virtual {p0, p1}, Lcom/nemustech/regina/XMLRecordAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {p0}, Lcom/nemustech/regina/XMLRecord;->canUpdated()Z

    move-result v0

    return v0
.end method
